﻿using DoNet.Core;
using DoNet.System.Dtos;
using DoNet.System.IRepositories;
using DoNet.System.IServices;
using DoNet.System.Models;

namespace DoNet.System.Services
{

    public class RoleService : BaseService<Role, RoleOutputDto>, IRoleService
    {
        /// <summary>
        /// 
        /// </summary>
        private readonly IRoleRepository repository;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_baseRepository"></param>
        /// <param name="_repository"></param>
        public RoleService(IRepository<Role> _baseRepository, IRoleRepository _repository)
        {
            baseRepository = _baseRepository;
            repository = _repository;
        }

        #region 同步方法
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public IEnumerable<Role> GetListByIds(IEnumerable<long> ids)
        {
            return repository.GetListByIds(ids);
        }
        #endregion 同步方法

        #region 异步方法
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<IEnumerable<Role>> GetListByIdsAsync(IEnumerable<long> ids)
        {
            return await repository.GetListByIdsAsync(ids);
        }
        #endregion 异步方法
    }
}
